package com.shark.rebirth;

import android.app.Service;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;

import androidx.appcompat.app.AppCompatActivity;

import com.shark.lib.rebirth.RebirthEnv;

public class MainActivity extends AppCompatActivity implements View.OnClickListener {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);

        findViewById(R.id.btn_start).setOnClickListener(this);
        findViewById(R.id.btn_stop).setOnClickListener(this);

    }

    @Override
    public void onClick(View view) {
        switch (view.getId()) {
            case R.id.btn_stop:
                RebirthEnv.sendStopWorkBroadcast(MainActivity.this);
                break;
            case R.id.btn_start:
                RebirthEnv.sendStartWorkBroadcast(MainActivity.this, Service1.class);
                break;
        }
    }
}
